]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Disconnect from InputMethod::terminal-mode-changed on destruction
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 16 Nov 2022 10:42:46 +0000 (11:42 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 16 Nov 2022 18:06:27 +0000 (18:06 +0000)
The OSK may be created and destroyed, while it connects to signals from the
longer-lived InputMethod object. This makes these signals linger and issue
copious warnings while trying to change the extended keymap and new ratio
on a defunct OSK.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6085
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2543>

js/ui/keyboard.js

index 7e40f62af20e546ffb994a07cca5d2e9072886e1..78c024524e594cb97111068a6e790a0eecca42e5 100644 (file)
@@ -1430,8 +1430,9 @@ var Keyboard = GObject.registerClass({
         this._ensureKeysForGroup(this._keyboardController.getCurrentGroup());
         this._setActiveLayer(0);
 
-        Main.inputMethod.connect(
-            'terminal-mode-changed', this._onTerminalModeChanged.bind(this));
+        Main.inputMethod.connectObject(
+            'terminal-mode-changed', this._onTerminalModeChanged.bind(this),
+            this);
 
         this._keyboardController.connectObject(
             'active-group', this._onGroupChanged.bind(this),